package com.yun.zf.admin.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.yun.zf.common.admin.domain.ZfPactPersonInfo;
import com.yun.zf.common.admin.dto.pact.PactPersonDto;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * <p>
 * 合同甲乙双方信息 Mapper 接口
 * </p>
 *
 * @author cj
 * @since 2021-07-24
 */
public interface ZfPactPersonInfoMapper extends BaseMapper<ZfPactPersonInfo> {

    @Select("<script>" +
            "  SELECT id personId, type, `name`,card_type ,sex, birthday,citizenship ,card_no,iphone,address, email from zf_pact_person_info pi WHERE  pi.pact_id= #{pactId}  and city_code=#{cityCode} and province_code=#{provCode} " +
            "</script>")
    List<PactPersonDto> getPersons(Long provCode, Long cityCode, Long pactId);

    @Select("<script>" +
            "  SELECT id personId, type, `name`,card_type ,sex, birthday,citizenship ,card_no,iphone,address, email from zf_pact_person_info pi WHERE   pi.type!=1 and  pi.pact_id= #{pactId}  and city_code=#{cityCode} and province_code=#{provCode} " +
            "</script>")
    List<PactPersonDto> getPersonsNotJ(Long provCode, Long cityCode, Long pactId);
}
